<template>
  <div class="home-container">
    <div style="background: #ececec; padding: 25px">
      <a-row :gutter="16">
        <a-col :span="8">
          <a-card>
            <a-statistic
              title="金额"
              :value="26000.18"
              :precision="2"
              prefix="￥"
              :value-style="{ color: '#3f8600' }"
              style="margin-right: 50px"
            >
              <!-- <template #prefix>
                <arrow-up-outlined />
              </template> -->
            </a-statistic>
          </a-card>
        </a-col>
        <a-col :span="8">
          <a-card>
            <a-statistic title="订单量" :value="50" :precision="0" style="margin-right: 50px" />
          </a-card>
        </a-col>
        <a-col :span="8">
          <a-card>
            <a-statistic
              title="用户数"
              :value="18000"
              :precision="0"
              :value-style="{ color: '#1890ff' }"
            />
          </a-card>
        </a-col>
      </a-row>
    </div>
    <div style="margin-top: 25px">
      <a-carousel autoplay>
        <div>
          <a href="http://ecapi.cn" target="_blank" rel="noopener noreferrer">
            <a-image
              :preview="false"
              src="https://img.alicdn.com/imgextra/i1/573804794/O1CN01E8blBM1lHhPq50E02_!!573804794.jpg"
              height="110px"
              width="100%"
            />
          </a>
        </div>
      </a-carousel>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, watchEffect } from 'vue'
import { Statistic, Row, Col, Carousel, Image } from 'ant-design-vue'
import { SettingOutlined, EditOutlined, EllipsisOutlined } from '@ant-design/icons-vue'
import { useStore } from '@/store'

export default defineComponent({
  name: 'Workplace',
  components: {
    [Statistic.name]: Statistic,
    [Carousel.name]: Carousel,
    [Image.name]: Image,
    [Row.name]: Row,
    [Col.name]: Col,
    SettingOutlined,
    EditOutlined,
    EllipsisOutlined
  },
  setup() {
    const userInfo = useStore().getters['user/userInfo']
    watchEffect(() => {})
    return {
      userInfo
    }
  }
})
</script>

<style lang="scss" scoped>
.box {
  width: 100%;
  height: calc(100vh - 280px);
  display: flex;
  flex-direction: column;

  img {
    flex: 1;
    min-height: 0;
  }

  .ant-form {
    flex: 2;
  }
}
</style>
